]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
switcherPopup: Improve modifier-less keybinding navigation
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 11 Nov 2019 21:00:01 +0000 (22:00 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 22 Nov 2019 23:46:31 +0000 (23:46 +0000)
Commit c899453800f11 lifted the requirement of switcher keybindings
to contain a modifier, however it is currently only possible to
finish it by letting it time out.

Improve that by also accepting space/enter key presses to confirm the
selection immediately.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1883

js/ui/switcherPopup.js

index fc982781f8093a9369831734a9b6230021d7c6be..e5efcfaeca335a037f0459931d4ded973bbe8501 100644 (file)
@@ -186,6 +186,14 @@ var SwitcherPopup = GObject.registerClass({
         if (keysym === Clutter.KEY_Escape || keysym === Clutter.KEY_Tab)
             this.fadeAndDestroy();
 
+        // Allow to explicitly select the current item; this is particularly
+        // useful for no-modifier popups
+        if (keysym === Clutter.KEY_space ||
+            keysym === Clutter.KEY_Return ||
+            keysym === Clutter.KEY_KP_Enter ||
+            keysym === Clutter.KEY_ISO_Enter)
+            this._finish(keyEvent.time);
+
         return Clutter.EVENT_STOP;
     }